/**
 * File comment: framework complete
 */
package edu.gatech.oad.project.networking.messages;

import java.io.Serializable;

/**
 * Framework for the messages to send across the network
 * 
 * @author James Moore
 * @version 1.0
 */
public abstract class Message implements Serializable{

    /**
     * Field serialVersionUID: id
     */
    private static final long serialVersionUID = -8923081100151664556L;

    /**
     * Field data: Data to store in the message
     */
    protected Object[] data;
    
    /**
     * Field token: security token
     */
    protected long token;
    
    /**
     * Default constructor
     * 
     * @param data to sent
     * @param token security token
     */
    public Message(Object[] data, long token) {
        this.token = token;
        this.data = data; // $codepro.audit.disable com.instantiations.assist.eclipse.arrayIsStoredWithoutCopying
    }
    
    /**
     * @return the data
     */
    public Object[] getData() {
        return data;
    }
    
    /**
     * @return the security token
     */
    public long getToken() {
        return token;
    }
    
    /**
     * Takes the data needed to send back to the client and stores it in the
     * proper response.
     * 
     * @return the response
     */
    public abstract Message handle();
}
